Learning Python for Forensics by Preston Miller
Author:Preston Miller
Language: eng
Format: epub
Tags: COM053000 - COMPUTERS / Security / General, COM043050 - COMPUTERS / Security / Networking, COM015000 - COMPUTERS / Security / Viruses and Malware
Publisher: Packt Publishing
Published: 2019-01-31T22:06:36+00:00
Writing Excel spreadsheets – xlsx_writer.py
The xlsx_writer.py script contains the logic for creating an excel document containing our processed UserAssist values. In addition to this, this script also creates an additional worksheet that contains summarizing charts of our data. The xlsxwriter is imported on line 1 and is the third-party module we use to create the Excel document. The itemgetter function, imported on line 3, will be used and explained in the sorting functions later in this section. We have seen the datetime and logging modules from previous chapters:
001 from __future__ import print_function
002 import xlsxwriter
003 from operator import itemgetter
004 from datetime import datetime, timedelta
005 import logging
There are six functions in the xlsx_writer.py script. The coordinating logic is handled by the excel_writer() function defined on line 36. This function creates our Excel workbook object and then hands it off to the dashboard_writer() and userassist_writer() functions to create the dashboard and UserAssist worksheets, respectively.
The remaining three functions, file_time(), sort_by_count(), and sort_by_date(), are helper functions used by the dashboard and UserAssist writers. The file_time() function is responsible for converting FILETIME objects that we parsed from the raw UserAssist data into datetime objects. The sorting functions are used to sort the data by either count or date. We use these sorting functions to answer some basic questions about our data. What are the most-used applications? What are the least-used applications? What were the last 10 applications used on the machine (according to UserAssist)?
036 excel_writer(): ... 071 dashboard_writer(): ... 156 userassist_writer(): ... 201 file_time(): ... 214 sort_by_count(): ... 227 sort_by_date():
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7778)
Grails in Action by Glen Smith Peter Ledbrook(7696)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6548)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6535)
Running Windows Containers on AWS by Marcio Morales(6064)
Kotlin in Action by Dmitry Jemerov(5062)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(4906)
Combating Crime on the Dark Web by Nearchos Nearchou(4487)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4414)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4321)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4160)
The Age of Surveillance Capitalism by Shoshana Zuboff(3948)
Python for Security and Networking - Third Edition by José Manuel Ortega(3728)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3508)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3398)
Mastering Python for Networking and Security by José Manuel Ortega(3344)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3330)
Blockchain Basics by Daniel Drescher(3292)
Learn Wireshark by Lisa Bock(3242)
